package com.itheima;

import com.itheima.config.SpringConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationContextTest {
    public static void main(String[] args) {
//        ClassPathXmlApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");

        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfig.class);
        Object dataSource = applicationContext.getBean("dataSource");
        System.out.println("dataSource = " + dataSource);
    }
}
